function showPic(whichpic) {
    var source = whichpic.getAttribute("href");
    var placeHolder = document.getElementById("placeholder");
    var text = whichpic.getAttribute("title")
    var description = document.getElementById("description");
    description.firstChild.nodeValue = text;
    placeHolder.setAttribute("src", source);
}

window.onload = function () {
    var nodeli = document.getElementById("imagegallery");
    if (nodeli.childNodes.length > 0) {
        var nodesA = nodeli.getElementsByTagName("a");
        for (var i = 0; i < nodesA.length; i++) {
            nodesA[i].onclick = function () {
                showPic(this);
                return false;
            }
        }
    }
    // if (nodesA.length > 0) {
    //     for (var i = 0; i < nodesA.length; i++) {
    //         nodesA[i].onclick = function () {
    //             showPic(this);
    //             return false;
    //         }
    //     }
    //
    // }
}